package com.yc.testThread;

/**
 * Created with IntelliJ IDEA.
 * description:
 * author: yc
 * date: 2021/4/8 18:24
 */
public class TestSynchronized {

    public synchronized static void m() {
        System.out.println(Thread.currentThread().getName() + "-----1");
        System.out.println(Thread.currentThread().getName() + "-----2");
    }

    public static void main(String[] args) {
        for (int i=0; i<100; i++) {
            new Thread(() -> {
                TestSynchronized.m();
            }).start();
        }

    }
}
